package com.laf.sinaweibo.ui;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.laf.sinaweibo.R;


public class WebView1Activity extends Activity implements IWeiboActivity {
	
	private WebView webView;
	private ProgressDialog pDialog;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.webview);
		
		webView = (WebView) findViewById(R.id.wv_oauth);
		webView.getSettings().setJavaScriptEnabled(true);
		
		webView.setWebViewClient(new WebViewClient() {
			
		});
		
		webView.setWebChromeClient(new WebChromeClient() {
			
			@Override
			public void onProgressChanged(WebView view, int newProgress) {
				super.onProgressChanged(view, newProgress);
				
				if (newProgress == 100) {
					pDialog.dismiss();
				}
			}
		});
	}

	@Override
	public void init() {
		if (pDialog == null) {
			pDialog = new ProgressDialog(this);
		}
		pDialog.show();
	}

	@Override
	public void refresh(Object... params) {
		
	}
	
}
